const Base = require('../base.js');

module.exports = class extends Base {
  /// 修改廣告配置
  async indexAction() {
    let admin_login = await this.session('admin_login')
    if (!admin_login) {
      return this.fail(-1, '未授權的訪問')
    }
    let data = this.post()
    let result = await this.model('config/set').adConfig(data)
    // 返回数据
    this.json({
      status: 200,
      message: 'success',
      data: result
    })
  }
};
